/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ivanbiz.impl;

import com.ivanbiz.dao.ReturPembelianDAO;
import com.ivanbiz.model.HibernateUtil;
import com.ivanbiz.model.ReturPembelian;
import java.util.List;
import org.hibernate.Session;

/**
 *
 * @author Aprisma
 */
public class ReturPembelianDAOImpl extends GenericDAOImpl implements ReturPembelianDAO {

    public void saveItemReturPembelian(List<ReturPembelian> listReturPembelian) throws Exception {
        try {
            HibernateUtil.beginTransaction();
            Session session = HibernateUtil.getSession();
            for (ReturPembelian returPembelian : listReturPembelian) {
                session.save(returPembelian);
            }
            HibernateUtil.commitTransaction();
        } catch (Exception e) {
            HibernateUtil.rollbackTransaction();
            throw e;
        } finally {
            HibernateUtil.closeSession();
        }
    }
}
